package designPattern.behavioralPattern.visitor;

/**
 * @author wei.zhao
 * @description:
 * @date 2021年12月23日 10:50
 */
public class Test {
    public static void main(String[] args) {
        ObjectStructure objectStructure = new ObjectStructure();
        objectStructure.attach(new ConcreteElementA());
        objectStructure.attach(new ConcreteElementB());
        ConcreteVisitor1 visitor1 = new ConcreteVisitor1();
        objectStructure.accept(visitor1);
        ConcreteVisitor2 visitor2 = new ConcreteVisitor2();
        objectStructure.accept(visitor2);
    }
}
